package cn.tradewin.advisor.commons.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import net.sf.ehcache.CacheManager;

public class AdvisorContextListener implements ServletContextListener {

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		System.out.println("---------------------startup---------------------------");
		CacheManager.create(CacheManager.class.getClassLoader().getResource("ehcache.xml"));
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		System.out.println("---------------------shutdown---------------------------");
		CacheManager.getInstance().shutdown();
	}

}
